<?php
namespace zake\server\zadb;

use zake\foundation\point\Table;
use zake\foundation\reactor\trigger\Listen;


/**
 * Class TableListen
 * @package zake\server\table
 * 
 * @author liu.bin 2020-05-18 15:18
 */
class ZaListen extends Listen
{


    const URI = "unix:///".RUNTIME."/temp/table.socket";


    /**
     * @var null|ZaDb
     */
    private $db = null;



    /**
     * 构造器
     *
     * TableListen constructor.
     * @param $uri
     */
    protected function __construct($uri)
    {
        parent::__construct($uri);
        $this->setConnect(ZaConnect::class);
        $this->setProtocol(Table::singleton());
        $this->db = ZaDb::singleton();
    }


    /**
     *
     * @return null|ZaDb
     *
     * @author liu.bin 2020-05-18 18:38
     */
    public function getDb()
    {
        return $this->db;
    }

}
